package com.auto.sns.core.action;

import java.util.Date;

import com.auto.sns.core.domain.SnsCoreActivity;
import com.auto.sns.core.service.SnsCoreServiceFactory;
import com.auto.tools.AutoUtils;
import com.system.common.BaseAction;
import com.system.util.BeanUtil;
import com.system.util.DateUtil;
import com.system.util.JsonUtil;

/**
 * 活动action
 * @author wy
 *
 */
public class SnsCoreActivityAction extends BaseAction {
	/**
	 * 
	 */
	private static final long serialVersionUID = 8009126758851166441L;

	/**
	 * 获取当前活动列表
	 */
	public void getActivityInfoList(){
		
	}
	
	/**
	 * 获取某个人物详细信息
	 */
	public void getActivityInfo() throws Exception{
		
	}
	
	/**
	 * 添加活动
	 * @throws Exception 
	 */
	public void saveOrUpdateSnsCoreActivity() throws Exception{
		String data = getRequest().getParameter("data");
		SnsCoreActivity snsCoreActivity = (SnsCoreActivity)JsonUtil.jsonToBean(data, SnsCoreActivity.class);
		
		String scacDate = getRequest().getParameter("scacDate");
		if(BeanUtil.isNotBlank(scacDate)){
			snsCoreActivity.setScacDate(DateUtil.toDate(scacDate, DateUtil.DEFAULT_DATE_PATTERN));
		}
		
		snsCoreActivity.setPubDate(new Date());
		snsCoreActivity.setPubUserCode(AutoUtils.getUserCode());
		snsCoreActivity.setPubUserName(AutoUtils.getUserCode());
		
		SnsCoreServiceFactory.snsCoreInfoService.saveOrUpdateSnsCoreActivity(snsCoreActivity);
	}
	
	/**
	 * 回复活动
	 */
	public void replySnsCoreActivity(){
		
	}
	
	/**
	 * 推荐活动
	 */
	public void commendSnsCoreActivity(){
		
	}
	
	/**
	 * 关注活动
	 */
	public void favouriteSnsCoreActivity(){
		
	}
	
	/**
	 * 删除活动
	 */
	public void deleteSnsCoreActivity(){
		
	}
	
}